<%@ page language="java" contentType="text/html; charset=UTF-8"  isELIgnored="false"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<script src="${pageContext.request.contextPath}/js/jquery-3.4.1.min.js"></script>
<style>
	table{
		width: 600px;

	}
	tr{
		height: 40px;

	}
	td {
		width: 80px;
		border-bottom:1px dashed lightgrey;
	}

	.submitBtn{
		display: block;
		border: none;
		background-color: dodgerblue;
		color: white;
		width: 250px;
		height: 30px;
		line-height: 30px;
		text-decoration: none;
		text-align: center;
		margin-top: 10px;

	}
</style>
<html>

    <head>
        
    </head>
    
    <body>
        
    <form id="payForm" action="<%=request.getContextPath() %>/alipay/goAlipay" method="post">
    	<input type="hidden" name="orderId" value="${order.id }" />
        <table>
        	<tr>
        		<td>
        			订单编号: ${order.id }
        		</td>
        	</tr>
			<tr>
        		<td>
        			产品名称: ${order.orderName }
        		</td>
			</tr>
        	<tr>

        		<td>
        			订单价格: ${order.orderMoney }
        		</td>

        	</tr>
			<tr>
        		<td>
        			购买个数：1
        		</td>
        	</tr>
        	<tr>
        		<td>
        			<input class="submitBtn" type="submit" value="前往支付宝进行支付">
        			
        			<input class="submitBtn" type="button" value="微信扫码支付" onclick="wxpayDisplay()">
        		</td>
        	</tr>
        </table>
    </form>
    
    	
        <input type="hidden" id="hdnContextPath" name="hdnContextPath" value="<%=request.getContextPath() %>"/>
    </body>
    
</html>


<script type="text/javascript">

	function wxpayDisplay() {
		debugger;
		
		var hdnContextPath = $("#hdnContextPath").val();
		
		$("#payForm").attr("action", hdnContextPath + "/wxpay/createPreOrder.action");
		$("#payForm").submit();
	}

	

</script>

